/*
* Project : Linuxbox
* File    : UserManAdd.java
* Version : 1.0
* Author  : Kevin Zhang
*
* Copyright (c) 2000-2001 by Linuxbox, Inc.
* All rights reserved.
 */
package linuxbox.status.servlet;

import javax.servlet.http.*;

import linuxbox.BoxStatic;
import linuxbox.common.*;
import linuxbox.status.logic.*;

public class StatusSetAction extends Action {
  protected static final String ID_PARAM = "ID";
  protected static final String STATUS_ID_PARAM = "STATUS_ID";
  protected static String successJSP = null;

  public void doAction(HttpSession aSession, BoxSession aBoxSession,
                       HttpServletRequest req, HttpServletResponse res) throws Exception {
    BoxStatic.logger.debug("I am in StatusSetAction now ... ");
    String userID = req.getParameter(ID_PARAM);
    String statusID = req.getParameter(STATUS_ID_PARAM);
    BoxStatic.logger.debug("id is " + userID);
    BoxStatic.logger.debug("statusid is " + statusID);
    StatusManager sm = StatusManager.getInstance();
    sm.setUserStatus(Integer.parseInt(userID), Integer.parseInt(statusID));

    redirectFile(successJSP, req, res);
  }

  public void setSuccessJSP(String str) {
    successJSP = str;
  }
}